<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    <script type="text/javascript" src="js/jquery-2.0.0.min.js"></script>
    <title>My JSP 'car_detail_view.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<script type="text/javascript">
var xmlhttp;
	function MovePtz(cmd) {
		var param = "dir=" + cmd;
		//GetXml("http://192.168.1.106:81/moveptz.xml?" + param);
		

    
    if (window.XMLHttpRequest)
      {// code for IE7+, Firefox, Chrome, Opera, Safari
      xmlhttp=new XMLHttpRequest();
      }
    else
      {// code for IE6, IE5
      xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
      }

    xmlhttp.open("GET","movePtz?"+param,true);
    xmlhttp.send();
	}


function stopPtz(){
    
    if (window.XMLHttpRequest)
      {// code for IE7+, Firefox, Chrome, Opera, Safari
      xmlhttp=new XMLHttpRequest();
      }
    else
      {// code for IE6, IE5
      xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
      }

    xmlhttp.open("GET","movePtz?dir=stop",true);
    xmlhttp.send();

}

function onload(){

}
</script>
  </head>
  
  <body onload="onload()">

    <img id="showimg" alt="" src="showImg.action">
    <br><button style="margin-left:35px" onmousedown="MovePtz('up')" onmouseup="stopPtz()">上</button><br>
    <button onmousedown="MovePtz('left')" onmouseup="stopPtz()">左</button>
    <button style="margin-left:25px" onmousedown="MovePtz('right')" onmouseup="stopPtz()">右</button><br>
    <button style="margin-left:35px" onmousedown="MovePtz('down')" onmouseup="stopPtz()">下</button><br>
  </body>
</html>
